import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './api'
import ref from 'vue-ref'
/* ElementUI */
import ElementUI from 'element-ui'

// 引入字体样式
import './common/fonts/font.less'
import animate from 'animate.css'

import '@/assets/reset.min.css'

import '@/style/index.less'
import 'element-ui/lib/theme-chalk/index.css'
/* OTHER */
import './directive' // 权限全局自定义指定
import installGobalDirective from '@/views/指令与自定义指令/globalDirective' // 自定义全局指定
import GobalMixin1 from './views/mixinTest/GobalMixin1' // 全局混入
// import VueLazyload from 'vue-lazyload';

// Vue.use(VueLazyload);
Vue.use(animate)
Vue.use(ElementUI)
Vue.use(ref, { name: 'ant-ref' }) // name是自定义api名称
Vue.prototype.$api = api
Vue.config.productionTip = false
Vue.mixin(GobalMixin1)

// 全局过滤
Vue.filter('toThousandFilter', function (value) {
  if (!value) return ''
  value = value.toString()
  return value.replace(
    value.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g,
    '$1,'
  )
})

installGobalDirective(Vue)
new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
